#include <sdkddkver.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>


BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID)
{
	if (ul_reason_for_call == DLL_PROCESS_ATTACH)
		::DisableThreadLibraryCalls(hModule);
	return TRUE;
}

#include <WinSock2.h>
#include <assert.h>

static struct PTInitOnceWSA
{
	PTInitOnceWSA()
	{
		WSADATA WSAData;
		int WSAResult = ::WSAStartup(MAKEWORD(2, 2), &WSAData);
		assert(WSAResult == 0);
	}
	~PTInitOnceWSA()
	{
		int WSAResult = ::WSACleanup();
		assert(WSAResult == 0);
	}
}g_PTInitOnceWSA;